package com.example.mvp.view

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.example.mvp.presenter.IPresenter

abstract class BaseFragment<P : IPresenter> : Fragment(),IFragment {

     lateinit var view1: View


     lateinit var myprefrag: P

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        view1 = inflater.inflate(findlayout(),container,false)
        return view1

    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        initView()
        initData()
    }

    override fun <T : View> findViewById(id: Int): View {
        return view1.findViewById(id)
    }
}